﻿
using GalaSoft.MvvmLight.Messaging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[assembly: log4net.Config.XmlConfiguratorAttribute(ConfigFile = "Log.config", Watch = true)]
namespace Comm
{

    public class Logger
    {
        static readonly log4net.ILog ILog
                 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        public static void Log(string msg, bool nofity = true)
        {
            if (nofity)
            {
                Messenger.Default.Send<string>(msg, "ReceiveEventInfo");
            }
            ILog.Info(msg);
        }
        public static void Info(string msg, bool nofity = true)
        {
            if (nofity)
            {
                Messenger.Default.Send<string>(msg, "ReceiveEventInfo");
            }
            ILog.Info(msg);
        }
        public static void Error(string msg, bool nofity = true)
        {
            if (nofity)
            {
                Messenger.Default.Send<string>(msg, "ReceiveEventInfo");
            }
            ILog.Error(msg);
        }
    }
}
